let g:ycm_server_python_interpreter='/opt/miniconda3/bin/python3'
let g:ycm_global_ycm_extra_conf='~/.vim/.ycm_extra_conf.py'
nnoremap <Leader><Leader>fi :YcmCompleter FixIt<CR>
nnoremap <Leader><Leader>gt :YcmCompleter GoTo<CR>
nnoremap <Leader><Leader>gd :YcmCompleter GoToDefinition<CR>
nnoremap <Leader><Leader>gh :YcmCompleter GoToDeclaration<CR>
nnoremap <Leader><Leader>gr :YcmCompleter GoToReferences<CR>
let g:ycm_auto_hover = ''
let g:ycm_complete_in_comments = 1
let g:ycm_filetype_whitelist = {
      \ 'c': 1,
      \ 'cpp': 1,
      \ 'python': 1,
      \ 'vim': 1,
      \ 'sh': 1,
      \ 'zsh': 1,
      \ 'go': 1,
      \ }
let g:ycm_goto_buffer_command = 'split-or-existing-window'
" ycm_key_invoke_completion 用来定义手工启用语义完成的按键。在你输入时，YCM 会自动尝试标识符匹配，而当你输入 .、->、:: 或这个按键时，YCM 则会启用语义完成，来给出当前上下文中允许出现的符号。这个按键默认是 <C-Space>，在某些操作系统上是不能用的（如 Mac 和老的 Windows），所以我改成了 <C-Z>。
"let g:ycm_key_invoke_completion = '<C-Z>'
"" make YCM compatible with UltiSnips (using supertab)
let g:ycm_key_list_select_completion = ['<C-n>', '<Down>']
let g:ycm_key_list_previous_completion = ['<C-p>', '<Up>']
